Be sure that you have a debugger installed on the machine that you run these on, because any errors cause calls to the debugger. If you don't have a debugger, you will get an "Unimplemented A-Trap" if any sort of an error occurs. You may use Macsbug, Jasik's Debugger, TMON, etc.
If you have a previous version of Writeswell Jr. that is earlier than 1.0d8, you must trash the Writeswell Jr. Preferences file. It is in the Preferences folder. Otherwise you will get an error message when Writeswell Jr. starts up.
The source is included to the text editor, which may be freely distributed.
We are testing a new version of Writeswell Jr. that will open TeachText-style read only documents with pictures. We encourage developers to use it to open Read Me files on product disks and billboard postings - for free! Send me e-mail to get it. It will probably be available on online services by the time you read this. Look for Writeswell Jr. 1.1.1 or later.
••• The application "IAC Spell Test" and the dictionary may only be distributed to programmers for use in developing Word Services applications. IAC Spell Test will cause system errors unless it is used on a System 7 Macintosh with a debugger installed. •••
(Regular users may purchase Spellswell 7 from Working Software. It runs fine on System 6 and has extra features such as traditional document checking and a nicer interface. See the Spellswell 7 Demo on the SDK disk).
Double-click "IAC Spell Test". Then drag "testtext" onto the "Writeswell Jr." icon. Select "Get New Service" from Writeswell Jr.'s menu. Select the speller in the browser. This adds "Check Spelling with IAC Spell Test" to the Services Menu. Then you can use this menu item to check spelling. After this initial setup the menu item will launch the speller whether it is running in the background or not, making it invisible to the user that the speller is not a built-in menu item.
Position the speller's window so you can see the text in Writeswell Jr., and hit skip or replace as you like.
The technique that I use for handling Apple Events is the "Object First Approach" described by Richard Clark in the May, 1992 issue of d e v e l o p, in the article "Apple Event Objects and You."
I call this an "inverted" handling method myself in the code. I resolve the object specifier first (in a wildcard handler), and then pass the token to a dispatcher that calls the functions to actually do the event. The "normal" way to do it is to install a handler for each event, resolve the object specifier, and then call code to do the event for each type. The object first approach allows new data types to be added in a simpler manner.
I highly recommend reading Richard's article while studying this code.
The Object Support Library on this disk is converted from the MPW OSL using the ThinkC "oConv" utility. If you want to do the conversion yourself, use the vocabulary file in the Apple Libraries folder. If you convert without using the vocabulary file, the OSL function names will all be uppercase.